<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var red;
        var white;
        var black;
        for (let i = 25; i > 0; i--) {
            red = i;
            white = 25 - i;
            for (let j = 31; j > 0; j--) {
                black = j;
                if (white + black == 31 && red + black == 28) {
                    alert("红球：" + red + "\n" + "白球：" + white + "\n" + "黑球：" + black);
                }
            }
        }
    </script>
</body>
</html>